﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace cs2335lab5
{
    namespace Data
    {
        /// <summary>
        /// Service contract that defines the operations between client and server
        /// </summary>
        [ServiceContract(
            Name="NetworkManager",
            CallbackContract=typeof(INetworkManagerCallback),
            SessionMode=SessionMode.Required)]
        public interface INetworkManager
        {
            [OperationContract]
            bool Connected();

            [OperationContract]
            Data.User Authenticate(Data.User user);

            [OperationContract]
            void LogOut(Data.User user);

            [OperationContract]
            Data.User GetUser(string name);

            [OperationContract]
            Data.Issue GetIssue(Int64? id);

            [OperationContract]
            Dictionary<string, Data.User> GetUserList();

            [OperationContract]
            Dictionary<Int64?, Data.Issue> GetIssueList();

            [OperationContract]
            bool IssueStateChanged(Data.User user);

            [OperationContract]
            bool UserStateChanged(Data.User user);

            [OperationContract]
            Data.User Register(Data.User user);

            [OperationContract]
            Data.User AddUser(Data.User actor, Data.User user);

            [OperationContract]
            Data.User UpdateUser(Data.User actor, Data.User user);

            [OperationContract]
            Data.Issue AddIssue(Data.User actor, Data.Issue issue);

            [OperationContract]
            Data.Issue UpdateIssue(Data.User actor, Data.Issue issue);

            [OperationContract]
            void DeleteUser(string key);

            [OperationContract]
            void DeleteIssue(Int64? key);

            [OperationContract]
            void KickUser(Data.User actor, Data.User reciever);
        }
    }
}